//
//  PluginCell.m
//  HGMMT
//
//  Created by huan liu on 2019/1/8.
//  Copyright © 2019年 eport_user1. All rights reserved.
//

#import "PluginCell.h"
#import "UIView+ViewController.h"
#import "HGPluginViewController.h"



@implementation PluginCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self initUI];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)runAction:(UIButton *)sender {
   
    HGPluginViewController *HGPlugin = [[HGPluginViewController alloc]init];
    [HGPlugin startPageSetting:self.model];
    [self.viewContoller.navigationController pushViewController:HGPlugin animated:YES];

}



-(void)initUI{
    
    [self.runButton setTitleColor:HGBTN_TitleColor forState:(UIControlStateNormal)];
    self.runButton.backgroundColor = HGBTN_BackgoundColor;
    self.bottomLabel.textColor = [UIColor colorWithRed:37/255.0 green:80/255.0 blue:155/255.0 alpha:1];
    
}

- (void)setModel:(PluginModel *)model{
    
    if (_model != model) {
        
        _model = model;
    }
    
    [self setNeedsLayout];
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    /*
     0002:{"id":1,"name":"test","nameCN":"","dept":"caac","version":"v0.1","frame":"ssl","root":"http://10.10.211.189:8181/HGMIDE/plugin/test"}
     */
    
    self.topLabel.text = self.model.nameCN;
    self.bottomLabel.text =[NSString stringWithFormat:@"version:%@",self.model.version];
    
}





@end
